import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
const store = new Vuex.Store({
    state: {
        loading:false,
        cartNumber:9
    },
    mutations: {
        //tf作为主动控制的参数
        switch_loading(state,tf){
			state.loading = tf;
        },
        //购物车
        addCart(state,num){
            state.cartNumber = state.cartNumber + num;
        }
    }
})
export default store